/*
 *  jOTR - Java Off-The-Record Messaging Library
 *  Copyright (C) 2007 Markus Karnik
 *
 *  This program is free software; you can redistribute it and/or modify it 
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation; either version 3 of the License, 
 *  or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
 *  for more details.
 *
 *  You should have received a copy of the GNU General Public License along 
 *  with this program; if not, see <http://www.gnu.org/licenses/>.
 *  
 */
package de.karnik.libjotr;

/**
 * This class implements the Diffie-Hellman key pair storage.
 * 
 * @author Markus Karnik - markus.karnik@my-design.org
 * @version 1.0
 * @since 1.0
 */
public class JotrDHKeyPair {

	/**
	 * The public dh key.
	 */
	private JotrMpi publicKey = null;
	/**
	 * The privat dh key.
	 */
	private JotrMpi privateKey = null;
	/**
	 * The key id of the dh key pair.
	 */
	private int keyID = 0;
	
	/**
	 * Constructs a JotrDHKeyPair object with the given public and private key.
	 * 
	 * @param publicKey The public key to use.
	 * @param privateKey The private key to use.
	 */
	public JotrDHKeyPair( JotrMpi publicKey, JotrMpi privateKey ) {
		super();
		this.publicKey = publicKey;
		this.privateKey = privateKey;
	}
	
	/**
	 * Returns the public dh key.
	 * 
	 * @return The public dh key.
	 */
	public JotrMpi getPublicKey() {
		return publicKey;
	}
	
	/**
	 * Sets the public dh key.
	 * 
	 * @param publicKey The public dh key to set.
	 */
	public void setPublicKey( JotrMpi publicKey ) {
		this.publicKey = publicKey;
	}
	
	/**
	 * Returns the private dh key.
	 * 
	 * @return The private dh key.
	 */
	public JotrMpi getPrivateKey() {
		return privateKey;
	}
	
	/**
	 * Sets the private dh key.
	 * 
	 * @param privateKey The private dh key to set.
	 */
	public void setPrivateKey( JotrMpi privateKey ) {
		this.privateKey = privateKey;
	}

	/**
	 * Returns the key id.
	 * 
	 * @return The key id.
	 */
	public int getKeyID() {
		return keyID;
	}

	/**
	 * Sets the key id.
	 * 
	 * @param keyID The key id to set.
	 */
	public void setKeyID(int keyID) {
		this.keyID = keyID;
	}
	
	/**
	 * Increments the key id.
	 */
	public void incKeyID() {
		this.keyID++;
	}	
}